Global GivingDate, ShortGivingDate, ExitFlag, DatePhrase
Answer "Do you wish to ERASE (ALL) of the income sub-account totals as " & "well as the records for income? This will set all totals to zero!" with "ERASE" or "Ooops - NO"
if it is "Ooops - NO" then exit mouseUp
answer "Have you printed out any needed information? This is your last chance to print any information before it will be erased." with "ERASE" or "Cancel"
if it is "Cancel" then exit mouseUp
answer "Clear Year To Date of 'Transactions' or 'Balances'?" with "Transactions" or "Balances" or "Both"
put it into whichtype
if whichType is "Both" then put 3 into WhichType
if whichtype is "Balances" then put 1 into WhichType
if whichtype is "Transactions" then put 2 into WhichType
put "Would you like the new recording date to be " into DatePhrase
put False into ExitFlag
send "DoDate" to background
if ExitFlag then exit mouseUp
go to card 1 of background "Sub Accounts"
set the name of background button id 21 to GivingDate
set numberformat to 0.00
go to last card of this background
put the id of this card into FlagCardID
if WhichType is 1 or WhichType is 3 then
put empty into background field "Sub Total2"
end if
if WhichType is 2 or WhichType is 3 then
put empty into background field "Sub Amount2"
end if
go to first card of this background
repeat until the ID of this card is FlagCardID
set lockscreen to false
if WhichType is 1 or WhichType is 3 then
put empty into background field "Sub Total2"
end if
if WhichType is 2 or WhichType is 3 then
put empty into background field "Sub Amount2"
end if
go to next card of this background
end repeat
go to card "Main" of background "Income"
show card field "Please Wait"
push card
put "This is a Record of Income Activity From" into Phrase
put phrase into line 1 of card field "Activity Report"
put shortGivingDate into Phrase
put phrase into line 2 of card field "Activity Report"
set cursor to 4
set lockscreen to true
hide card field "Please Wait"
put empty into card field "Totals"
put the ID of this card into FlagCardID
go to next card of background "Income"
put the ID of this card into ThisID
repeat forever
if FlagCardID is ThisID then exit repeat
put empty into background field "YTD Total"
go to next card of background "Income"
put the ID of this card into ThisID
end repeat
go to card "Main" of background "Income Record"
put the ID of this card into FlagCardID
go to next card of background "Income Record"
put the ID of this card into ThisID
repeat forever
if FlagCardID is ThisID then exit repeat
doMenu "Delete Card"
go to card "Main" of background "Income Record"
go to next card of background "Income Record"
put the ID of this card into ThisID
end repeat
pop card
set the name of background button ID 139 to ShortGivingDate